<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="index.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="favicon.ico">
<link rel="Shortcut Icon" href="favicon.ico" />
<title>主页</title>
<meta name="keywords" content="耶回收">
<meta name="description" content="耶回收">
</head>
<body>
	<!--_表格--开始-->
	<section class="Hui-article-box" style="overflow: auto"> <nav
		class="breadcrumb"> <i class="Hui-iconfont">&#xe67f;</i> 首页 <span
		class="c-gray en">&gt;</span> 回收地址修改 <span class="c-gray en">&gt;</span>
	</nav>
	<form method="post" action="updateRdRd" >
	<div class="page-container">
		<input type="hidden" value="${rd.sreceiverid}" name="sreceiverid" />
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">收件人姓名:</label>
			<div class="formControls col-xs-8 col-sm-6">
				<input type="text" class="input-text" value="${rd.sname}" placeholder="" id=""
					name="sname" required="required" >
			</div>
		</div>
		</div>
		<div class="page-container">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">收件人电话号码:</label>
			<div class="formControls col-xs-8 col-sm-6">
				<input type="text" class="input-text" value="${rd.smobile}" placeholder="" id=""
					name="smobile" required="required">
			</div>
		</div>
		</div>
		<div class="page-container">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">收件人所在省:</label>
			<div class="formControls col-xs-8 col-sm-6">
				<select class="demo" id="province"  onchange="getCity()" name="sprovincenam"  required="required">	
					<option value="">请选择</option>
				</select>
			</div>
		</div>
		</div>
		<div class="page-container">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">收件人所在市:</label>
			<div class="formControls col-xs-8 col-sm-6">
				<select class="demo" id="city" onchange="getDown()" name="scityname"  required="required">
					<option value="">请选择</option>
				</select>
			</div>
		</div>
		</div>
		<div class="page-container">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">收件人所在区:</label>
			<div class="formControls col-xs-8 col-sm-6">
				<select class="demo" id="area" name="sexpareaname"  required="required">
					<option value="">请选择</option>
				</select>
			</div>
		</div>
		</div>
		<div class="page-container">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">收件人详细地址:</label>
			<div class="formControls col-xs-8 col-sm-6">
				<input type="text" class="input-text" value="${rd.saddress}" name="saddress" required="required">	
			</div>
		</div>
		<div class="row cl" style="margin-top: 50px; margin-bottom: 100px">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<button class="btn btn-primary radius" type="submit" id="submit">
					<i class="Hui-iconfont">&#xe632;</i>修改
				</button>
			</div>
		</div>
	</div>
	</form>
	</section>
	<script type="text/javascript" src="lib/jquery-1.11.1.js"></script>
	<script type="text/javascript" src="lib/province.js"></script>
	<script type="text/javascript">
	

	var province = p.province;		
	$(function() {							
		for (var i = 0; i < province.length; i++) {								
			$("#province").append(
					"<option>" + province[i].name
							+ "</option>");
		}
	});

	//省份值改变事件
	function getCity() {
		//获取省份
		var s = $("#province").val();
		$("#city").empty();
		$("#area").empty();
		$("#city").append("<option>请选择</option>");
		$("#area").append("<option>请选择</option>");
		//获取省份下所有的市县
		for (var i = 0; i < province.length; i++) {
			if (s == province[i].name) {
				for (var j = 0; j < province[i].city.length; j++) {
					$("#city").append(
							"<option>" + province[i].city[j].name
									+ "</option>");
				}

			}
		}
	}

	function getDown() {
		//获取省份
		$("#area").empty();
		//$("#area").append("<option>请选择</option>");
		var s = $("#province").val();
		var c = $("#city").val();
		//获取省份下所有的市县
		for (var i = 0; i < province.length; i++) {
			if (s == province[i].name) {
				for (var j = 0; j < province[i].city.length; j++) {
					if (c == province[i].city[j].name) {
						for (var k = 0; k < province[i].city[j].area.length; k++) {
							$("#area").append(
									"<option>"
											+ province[i].city[j].area[k]
											+ "</option>");
						}
					}
				}
			}
		}
	}
	</script>
</body>
</html>